﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace LFSRecord2.View.Converters
{
    public class FrameToLeftMarginConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //return new Thickness((double)value, (double)parameter, 0, 0);
            int leftMargin = (int)value;
            return new Thickness(leftMargin - 5, 2, 0, 0);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return (int)((Thickness)value).Left + 5;
        }
    }
}
